git config ---global user.email xxx@gmai.com #添加自己邮箱到 git
git config ---global user.name xxx #添加自己用户名到 git
git config ---list #查看配置列表
ssh-keygen -t rsa -C "xxx@gmai.com"
Enter file in which to save the key (/home/shadow/.ssh/id\_rsa):
/home/shadow/.ssh/github\_rsa #自定义输入文件名
Enter passphrase (empty 'for' no passphrase):
#这里输入你想设置的密码,6位以上
Enter same passphrase again: #再次输入密码,6位以上
ssh-add ~/.ssh/github\_rsa #添加私钥
ssh-add -l #查看私钥是否运行
vim ~/.ssh/github\_rsa.pub #复制公钥内容
https://github.com/settings/keys #git 添加复制的公钥都 git 网站
ssh -T git@github.com #测试是否联通